<!--  -->
<template>
  <div class="charts" ref="charts">柱状图</div>
</template>

<script>
import * as echarts from 'echarts'
export default {
  name: 'BarCharts',
  data() {
    return {}
  },
  mounted() {
    //初始化
    let barCharts = echarts.init(this.$refs.charts)
    //配置数组
    barCharts.setOption({
      xAxis: {
        show: false,
        type: 'category',
      },
      yAxis: {
        show: false,
      },
      series: [
        {
          type: 'bar',
          data: [30, 33, 22, 50, 60, 22, 11, 45, 70, 22],
        },
      ],
      //布局调试
      grid: {
        left: 0,
        top: 0,
        right: 0,
        bottom: 0,
      },
      tooltip:{}
    })
  },
}
</script>
<style lang='scss' scoped>
.charts {
  width: 100%;
  height: 100%;
}
</style>